<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>3_数据类型</title>
</head>
<body>
    <script>
        //JS 原始类型 number string boolean null undefined
        var a = 1;
        var b = 3.14;
        console.log(a, typeof a, b, typeof b);//整数小数的数据类型都是number
        var c = "hello";
        var d = 'hello';
        console.log(c, typeof c, d, typeof d);//单引号双引号字符串的数据类型都是string
        var e = true;
        var f = false;
        console.log(e, typeof e, f, typeof f);//布尔值的数据类型都是boolean
        var g = null;
        console.log(g, typeof g);//null的数据类型是object
        var h;
        console.log(h, typeof h);//undefined的数据类型是undefined

        let obj = {
            name: '小明',
            age: 18
        }
        console.log(obj, typeof obj);
        console.log(obj.name);
        console.log(obj.age);
        obj.like = '吃鸡';
        console.log(obj.like);
        console.log(obj.play);

        let arr = ['小明', 18, '吃鸡' , true ,1.5];
        console.log(arr, typeof arr);
        for (let i = 0; i < arr.length; i++) {
            console.log(arr[i]);
        }
    </script>
</body>
</html>